﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Astronergy.MES.App.Library
{
    public class Constant
    {

        //数据文件监控路径
        public static string MonitorPath = ConfigurationManager.AppSettings["MonitorPath"];
        //原图片存储路径
        public static string ImageSourcePath = ConfigurationManager.AppSettings["ImageSourcePath"];
        //原图片存储路径格式化
        public static string ImageSourcePathFormat = ConfigurationManager.AppSettings["ImageSourcePathFormat"];
        //图片存储路径
        public static string ImageStoragePath = ConfigurationManager.AppSettings["ImageStoragePath"];
        //图片存储路径格式化
        public static string ImageStoragePathFormat = ConfigurationManager.AppSettings["ImageStoragePathFormat"];
        //图片存储站点地址
        public static string ImageSiteUrlFormat = ConfigurationManager.AppSettings["ImageSiteUrlFormat"];
        //数据文件类型后缀 *.xlsx：Excel *.mdb：Access
        public static string DataFileSuffix = ConfigurationManager.AppSettings["DataFileSuffix"];
        //工厂代码
        public static string Location = ConfigurationManager.AppSettings["Location"];

        public static String Suffix
        {
            get
            {
                string suffix = " "; ;
                Configuration config = ConfigurationManager.OpenExeConfiguration(typeof(Constant).Assembly.ManifestModule.Name);
                AppSettingsSection section = config.GetSection("appSettings") as AppSettingsSection;
                if (section != null)
                {
                    suffix = section.Settings["Location"].Value;
                }
                return suffix;
            }
        }


        //日志保存路径
        public static string LogPath = ConfigurationManager.AppSettings["LogPath"];

        //MailServer
        public static string MailServer = ConfigurationManager.AppSettings["MailServer"];
        //MailUserName
        public static string MailUserName = ConfigurationManager.AppSettings["MailUserName"];
        //Mail Password
        public static string MailPassword = ConfigurationManager.AppSettings["MailPassword"];
        //Mail From
        public static string MailFrom = ConfigurationManager.AppSettings["MailFrom"];
        //Mail Sender
        public static string MailSender = ConfigurationManager.AppSettings["MailSender"];
        //Mail To
        public static string MailTo = ConfigurationManager.AppSettings["MailTo"];
        //Mail CC
        public static string MailCc = ConfigurationManager.AppSettings["MailCc"];
    }
}
